home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 3
/
Risc World 3.iso
/
SOFTWARE
/
ISSUE2
/
PD
/
CAMPINS.ZIP
/
resources
/
returnline
(
.txt
)
< prev
Wrap
RISC OS BBC BASIC V Source
|
2002-05-29
|
1KB
|
67 lines
Returnline X V1.20 May 2002
Returnline [number] [path]
returns in system variable <Headline> the [number] line of text in file [path]
<rooturl> contains the root domain of the url for possible Referer use
By Stuart Halliday
buffer% 512
"OS_GetEnv"
command%
!command$=
getstring(command%)
6command$=
command$,
(command$)-
command$,""" ")-1)
command$="2 ADFS::HardDisc4.$.cURL.CamPins.resources.list2"
command$,1)=
command$=
command$,2)
command$,1)=
command$=
command$,
command$-1)
("UNSet Headline")
position%=
command$," ")
"number%=
command$,position%)
file$=
command$,position%+1)
file$=
canonpath(file$)
PRINT file$
"OS_File",5,file$
found%
found%<> 1
"OS_Find",&40,file$
handle%
numloop%=1
line$=
#handle%
numloop%+=1
numloop%>number%
#handle%
#handle%
(line$) =0
line$="no line found"
("Set Headline "+line$)
PRINT ">>";line$;"<<"
temp$=
line$,8)
temp$,"/")
rooturl$=
line$,P%+7)
("Set rooturl "+rooturl$)
getstring(ptr%)
0 p$=""
(?ptr%>31
?ptr%<256)
(p$)<255
c%=?ptr%
IF c%>=97 AND c%<=122 THEN c%-=32
p$+=
ptr%+=1
canonpath(path$)
"OS_FSControl",37,path$,buffer%,0,0,512
getstring(buffer%)